﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace EMoney.IStock.Client.Framework
{
    public class ConfigHelper
    {
        /// <summary>
        /// 金融平台是否开通订阅功能(1:开启，0不开启)
        /// </summary>
        public static string IsEmRss { get { return ConfigurationManager.AppSettings["IsEmRss"]; } }

        /// <summary>
        /// 金融平台SSOAccess
        /// </summary>
        public static string SSOAccess { get { return ConfigurationManager.AppSettings["ssoaccess"]; } }

        /// <summary>
        /// 金融平台缓存前缀
        /// </summary>
        public static string JRPTCachePre { get { return ConfigurationManager.AppSettings["JRPTCachePre"]; } }

        /// <summary>
        /// 静态文件地址
        /// </summary>
        public static string StaticFile { get { return ConfigurationManager.AppSettings["StaticFile"]; } }

        /// <summary>
        /// 客户端Redis地址
        /// </summary>
        public static string ClientRedis { get { return ConfigurationManager.AppSettings["ClientRedis"]; } }

        /// <summary>
        /// AppID
        /// </summary>
        public static string AppId { get { return ConfigurationManager.AppSettings["AppId"]; } }

        /// <summary>
        /// Key
        /// </summary>
        public static string Key { get { return ConfigurationManager.AppSettings["Key"]; } }

        /// <summary>
        /// 检查用户权限地址
        /// </summary>
        public static string CheckUserRightsUrl { get { return ConfigurationManager.AppSettings["CheckUserRightsUrl"]; } }

        /// <summary>
        /// 是否正式环境标识
        /// </summary>
        public static string IsOnline { get { return ConfigurationManager.AppSettings["IsOnline"]; } }

        /// <summary>
        /// 用户扩展信息入库间隔分钟数
        /// </summary>
        public static int UserExtendInfoWriteMinutes { get { return Convert.ToInt32(ConfigurationManager.AppSettings["UserExtendInfoWriteMinutes"]); } }

        /// <summary>
        /// 在线分钟数
        /// </summary>
        public static int OnlineTimeMinutes { get { return Convert.ToInt32(ConfigurationManager.AppSettings["OnlineTimeMinutes"]); } }

        /// <summary>
        /// 在线时长调用间隔
        /// </summary>
        public static int OnlineTimeIntervalMinutes { get { return Convert.ToInt32(ConfigurationManager.AppSettings["OnlineTimeIntervalMinutes"]); } }

        /// <summary>
        /// 用户扩展信息提交加密key
        /// </summary>
        public static string UserExtendInfoKey { get { return ConfigurationManager.AppSettings["UserExtendInfoKey"]; } }

        /// <summary>
        /// EmoneyBusiness
        /// </summary>
        public static string EmoneyBusiness { get { return ConfigurationManager.AppSettings["EmoneyBusiness"]; } }

        /// <summary>
        /// WebApiEncryptKey
        /// </summary>
        public static string WebApiEncryptKey { get { return ConfigurationManager.AppSettings["WebApiEncryptKey"]; } }

        /// <summary>
        /// WebAPIUrl
        /// </summary>
        public static string WebAPIUrl { get { return ConfigurationManager.AppSettings["WebAPIUrl"]; } }

        /// <summary>
        /// UserAppId
        /// </summary>
        public static string UserAppId { get { return ConfigurationManager.AppSettings["UserAppId"]; } }

        /// <summary>
        /// UserWebApiKey
        /// </summary>
        public static string UserWebApiKey { get { return ConfigurationManager.AppSettings["UserWebApiKey"]; } }

        /// <summary>
        /// 行情service
        /// </summary>
        public static string HQService { get { return ConfigurationManager.AppSettings["HQService"]; } }

        /// <summary>
        /// 非交易日
        /// </summary>
        public static string NotTradeDate { get { return ConfigurationManager.AppSettings["NotTradeDate"]; } }

        /// <summary>
        /// 我是传奇竞猜日期
        /// </summary>
        public static string CQGuessDate { get { return ConfigurationManager.AppSettings["CQGuessDate"]; } }

        /// <summary>
        /// 测试用户编号
        /// </summary>
        public static int TestUserID { get { return Convert.ToInt32(ConfigurationManager.AppSettings["TestUserID"]); } }
        /// <summary>
        /// 排行榜默认登录态qq设置
        /// </summary>
        public static string Default_QQ
        {
            get { return ConfigurationManager.AppSettings["Default_QQ"]; }
        }

        /// <summary>
        /// CmsServiceUrl
        /// </summary>
        public static string CmsServiceUrl { get { return ConfigurationManager.AppSettings["CmsServiceUrl"]; } }

        /// <summary>
        /// K线英雄-英雄榜 缓存时间
        /// </summary>
        public static int Cpyx { get { return Convert.ToInt32(ConfigurationManager.AppSettings["Cpyx"]); } }

        /// <summary>
        /// K线英雄-英雄榜 数量
        /// </summary>
        public static int CpyxYxbCount { get { return Convert.ToInt32(ConfigurationManager.AppSettings["CpyxYxbCount"]); } }

        public static string QQUrl { get { return ConfigurationManager.AppSettings["QQUrl"]; } }

        /// <summary>
        /// 行情接口地址
        /// </summary>
        public static string QuotesDataUrl { get { return ConfigurationManager.AppSettings["QuotesDataUrl"]; } }

        public static string SsoService { get { return ConfigurationManager.AppSettings["SsoService"]; } }

        public static byte[] AES_KEY
        {
            get
            {
                Encoding byteEncoder = Encoding.UTF8;
                return byteEncoder.GetBytes("E92B08&!F7&$F7&$");
            } 
        }

        public static byte[] AES_IV
        {
            get
            {
                Encoding byteEncoder = Encoding.UTF8;
                return byteEncoder.GetBytes("abcdefg_abcdefg_");
            }
        }
    }
}
